<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
      <el-form-item label="名称" prop="goodsName">
        <el-input
          v-model="queryParams.goodsName"
          placeholder="请输入组合套餐商品名称"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="上架状态" prop="marketEnable">
        <el-select v-model="queryParams.marketEnable" placeholder="上架状态" clearable>
          <el-option v-for="dict in dict.type.goods_market_enable" :key="dict.value"
            :label="dict.label" :value="dict.value" />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['goods:portfolio:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
          @click="handleDelete" v-hasPermi="['goods:portfolio:remove']">删除</el-button>
      </el-col>
    </el-row>

    <el-table
      border
      v-loading="loading"
      :data="goodsSkuList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="45" align="center" />
      <el-table-column label="ID" prop="id" :show-overflow-tooltip="true" align="center" />
      <el-table-column label="名称" prop="goodsName" width="320" :show-overflow-tooltip="true" align="center" />
      <el-table-column label="售价" prop="price" width="80" :show-overflow-tooltip="true" align="center" />
      <el-table-column label="库存" prop="quantity" width="80" :show-overflow-tooltip="true" align="center" />
      <el-table-column label="启用状态" width="100" prop="marketEnable" align="center">
        <template slot-scope="scope">
          <el-switch v-model="scope.row.marketEnable" active-value="UPPER" inactive-value="DOWN"
            @change="handleMarketEnableStatusChange(scope.row)" ></el-switch>
        </template>
      </el-table-column>
      <el-table-column label="排序" prop="sortOrder" width="80" :show-overflow-tooltip="true" align="center" />
      <el-table-column label="开始时间" prop="productionDate" :show-overflow-tooltip="true" align="center" />
      <el-table-column label="结束时间" prop="expirationDate" :show-overflow-tooltip="true" align="center" />
      <el-table-column label="图片" prop="original" :show-overflow-tooltip="true" align="center" >
        <template slot-scope="scope">
          <el-image style="width: 50px" :src="scope.row.original"> </el-image>
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button type="text" icon="el-icon-magic-stick" size="mini" @click="commodityDetails(scope.row)"
            v-hasPermi="['goods:portfolio:goods:list']">商品列表</el-button>

          <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"
            v-hasPermi="['store:promotion:promotion:goods:import']">
            <span class="el-dropdown-link">
              <i class="el-icon-d-arrow-right el-icon--right"></i>更多
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="uploadproduct" icon="el-icon-circle-check"
                v-hasPermi="['store:promotion:promotion:goods:import']">上传商品</el-dropdown-item>
              <el-dropdown-item command="openHandleSelectDate" icon="el-icon-grape"
                v-hasPermi="['goods:portfolio:time:edit']">修改时间</el-dropdown-item>
              <el-dropdown-item command="openHandleSortOrder" icon="el-icon-grape"
                v-hasPermi="['goods:sku:sortOrder:edit']">修改排序</el-dropdown-item>
              <el-dropdown-item command="handleChangeImage" icon="el-icon-delete"
                v-hasPermi="['goods:portfolio:image:edit']">更换图片</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改特价活动配置对话框 -->
    <el-dialog
      v-dialogDragWidth
      v-dialogDragHeight
      v-dialogDrag
      :title="updateTimeParagraphStatus"
      :visible.sync="open1"
      width="500px"
      append-to-body
    >
      <el-form ref="form" :model="form" label-width="100px">
        <el-form-item
          label="名称"
          prop="goodsName"
          :show-overflow-tooltip="true"
        >
          <el-input v-model="form.goodsName" />
        </el-form-item>
        <el-form-item
          label="库存"
          prop="quantity"
          :show-overflow-tooltip="true"
        >
          <el-input v-model="form.quantity" />
        </el-form-item>
        <el-form-item
          label="开始时间"
          prop="productionDate"
          :show-overflow-tooltip="true"
        >
          <el-date-picker
            type="datetime"
            placeholder="选择时间"
            v-model="form.productionDate"
            style="width: 100%"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item
          label="结束时间"
          prop="expirationDate"
          :show-overflow-tooltip="true"
        >
          <el-date-picker
            type="datetime"
            placeholder="选择时间"
            v-model="form.expirationDate"
            style="width: 100%"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item
          label="排序"
          prop="sortOrder"
          :show-overflow-tooltip="true"
        >
          <el-input v-model="form.sortOrder" />
        </el-form-item>
        <el-form-item label="图片" prop="detailAppImage">
          <div v-if="updateTimeParagraphStatus === '修改'">
            <input
              type="file"
              @change="requiredChange"
              v-show="!detailAppImageStatus"
            />
            <img
              class="detailAppImage"
              :src="form.original"
              v-show="detailAppImageStatus"
            />
            <span @click="deletePicture" v-show="detailAppImageStatus"
              >删除</span
            >
          </div>
          <div v-if="updateTimeParagraphStatus === '新增'">
            <input
              id="files"
              type="file"
              @change="requiredChange"
              v-show="!detailAppImageStatus"
            />
            <img
              class="detailAppImage"
              :src="form.original"
              v-show="detailAppImageStatus"
            />
            <span @click="deletePicture" v-show="detailAppImageStatus"
              >删除</span
            >
          </div>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 商品导入对话框 -->
    <el-dialog
      v-dialogDragWidth
      v-dialogDragHeight
      v-dialogDrag
      :title="upload.title"
      :visible.sync="upload.open"
      width="400px"
      append-to-body
    >
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="headers"
        :action="
          r +
          '/goods/portfolio/' +
          portfolioId +
          '/importData?updateSupport=' +
          upload.updateSupport
        "
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或 <em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link
            type="primary"
            :underline="false"
            style="font-size: 12px; vertical-align: baseline"
            @click="importTemplate"
            >下载模板</el-link
          >
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 商品详情 -->
    <el-dialog
      v-dialogDragWidth
      v-dialogDragHeight
      v-dialogDrag
      title="商品列表"
      :visible.sync="open"
      width="1200px"
    >
      <el-table :data="PORTFOLIOLIST">
        <el-table-column label="排序" prop="sortOrder" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.sortOrder"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="商品编码" prop="identifier" align="center">
        </el-table-column>
        <el-table-column
          label="商品名称"
          prop="goodsName"
          align="center"
          width="300px"
        >
        </el-table-column>
        <el-table-column
          label="商品原价"
          prop="originalPrice"
          align="center"
        ></el-table-column>
        <el-table-column label="活动价" prop="price" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.price"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="数量" prop="num" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.num"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="200px">
          <template slot-scope="scope">
            <!--
            <el-button size="mini" @click="modifyPromotionCommodity(scope.row)">修改</el-button>
            -->
            <el-button size="mini" @click="delSeckillCommodity(scope.row)"
              v-hasPermi="['goods:portfolio:sku:remove']">删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
      <pagination
        v-show="parseInt(PORTFOLIO.total) > 0"
        :total="parseInt(PORTFOLIO.total)"
        :page.sync="PORTFOLIO.pageNum"
        :limit.sync="PORTFOLIO.pageSize"
        @pagination="goodsList"
      />
    </el-dialog>

    <!-- 修改时间对话框 -->
    <el-dialog v-dialogDragWidth v-dialogDragHeight v-dialogDrag :title="title" :visible.sync="openUpdateTimeView" width="550px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-form-item label="开始时间" prop="startTime" class="start">
          <el-date-picker v-model="form.startTime" type="datetime" placeholder="选择日期时间"
            value-format="yyyy-MM-dd HH:mm:ss" :show-overflow-tooltip="true" ></el-date-picker>
        </el-form-item>
        <el-form-item label="结束时间" prop="endTime" class="start">
          <el-date-picker v-model="form.endTime" type="datetime" placeholder="选择日期时间"
            value-format="yyyy-MM-dd HH:mm:ss" :show-overflow-tooltip="true" ></el-date-picker>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormToUpdateTime">确 定</el-button>
        <el-button @click="openUpdateTimeView = false">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 更改图片对话框 -->
    <el-dialog v-dialogDragWidth v-dialogDragHeight v-dialogDrag :title="title" :visible.sync="openChangeImageView" width="500px" append-to-body>
      <el-form ref="form" :model="form" label-width="100px">
        <el-form-item label="图片地址" prop="imageUrl">
          <el-upload action="#" list-type="picture-card" :auto-upload="false"
            :on-remove="handleRemove" :on-preview="handlePictureCardPreview" :on-change="changeImg">
            <i slot="default" class="el-icon-plus"></i>
            <div slot="file" slot-scope="{ file }">
              <img class="el-upload-list__item-thumbnail" :src="file.url" alt />
              <span class="el-upload-list__item-actions">
                <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
                  <i class="el-icon-zoom-in"></i>
                </span>
                <span v-if="!disabled" class="el-upload-list__item-delete">
                  <i class="el-icon-download"></i>
                </span>
                <span v-if="!disabled" class="el-upload-list__item-delete"
                  @click="handleRemove(file)">
                  <i class="el-icon-delete"></i>
                </span>
              </span>
            </div>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt />
          </el-dialog>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="changeImage">确 定</el-button>
        <el-button @click="openChangeImageView = false">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 修改排序对话框 -->
    <el-dialog v-dialogDragWidth v-dialogDragHeight v-dialogDrag title="修改排序" :visible.sync="openUpdateSortOrderView" width="350px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-form-item label="排序值" prop="sortOrder" class="start">
          <el-input-number v-model="form.sortOrder" placeholder="请输入排序值"
            :show-overflow-tooltip="true" ></el-input-number>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormToUpdateSortOrder">确 定</el-button>
        <el-button @click="openUpdateSortOrderView = false">取 消</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import { listGoodsSku, changeGoodsSkuMarketEnable, changeGoodsSkuSortOrder } from "@/api/goods/goods";
import { getToken } from "@/utils/auth";
import {
  newCombinationPackage,
  getCombinationGoodsList,
  updateListingState,
  delCombinationPackageGoods,
  handleTimeChange,
  handleImageChange,
  deleteById,
} from "@/api/promotion/portfolio.js";
import axios from "axios";
import { uploadPicture } from "@/api/promotion/seckill";

export default {
  name: "Portfolio",
  dicts: ["goods_market_enable"],
  data() {
    return {
      loading: false,
      total: 0,
      multiple: false,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        goodsType: "PORTFOLIO",
      },
      goodsSkuList: [],
      upload: {
        open: false,
        "Content-Type": "multipart/form-data",
      },
      row: {},
      // 设置上传的请求头部
      headers: { Authorization: "Bearer " + getToken() },
      open: false,
      open1: false,
      PORTFOLIO: {
        total: 0,
        pageNum: 1,
        pageSize: 10,
      },
      PORTFOLIOLIST: [],
      id: "",
      r: process.env.VUE_APP_BASE_API,
      ROWS: {},
      form: {},
      updateTimeParagraphStatus: "",
      detailAppImageStatus: false,
      portfolioId: '',
      title: '',
      openUpdateTimeView: false,
      openChangeImageView: false,
      imageFileList: [],
      // 轮播图
      dialogImageUrl: "",
      dialogVisible: false,
      disabled: false,

      openUpdateSortOrderView: false,
      // 表单校验
      rules: {
        promotionName: [
          { required: true, message: "活动名称不能为空", trigger: "blur" }
        ],
        startTime: [
          { required: true, message: "开始时间不能为空", trigger: "blur" }
        ],
        endTime: [
          { required: true, message: "结束时间不能为空", trigger: "blur" }
        ],
        detailAppImage: [
          { required: true, message: "背景图不能为空", trigger: "blur" }
        ],
        sortOrder: [
          { required: true, message: "排序值不能为空", trigger: "blur" }
        ],
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询商品列表 */
    getList() {
      this.loading = true;
      listGoodsSku(0, this.queryParams).then((response) => {
        this.goodsSkuList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 上传商品
    Uploadproduct(row) {
      this.upload.title = "组合套餐商品导入";
      this.upload.open = true;
      console.log(row);
      this.portfolioId = row.id
    },
    // 商品详情
    commodityDetails(row) {
      this.row = row;
      this.open = true;
      this.goodsList();
    },
    // 获取数据
    goodsList() {
      getCombinationGoodsList(this.row.id, {}).then((res) => {
        if (res.code === 200) {
          this.PORTFOLIOLIST = res.data;
          this.PORTFOLIO.total = res.data.length;
        }
      });
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert(
        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
          response.msg +
          "</div>",
        "导入结果",
        { dangerouslyUseHTMLString: true }
      );
      this.getList();
    },
    /** 下载模板操作 */
    importTemplate() {
      this.download(
        "goods/portfolio/goods/importTemplate",
        {},
        `导入组合套餐商品模板_${this.parseTime(
          new Date().getTime(),
          "{y}-{m}-{d}_{h}{i}{s}"
        )}.xlsx`
      );
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.queryParams.pageSize = 10;
      this.queryParams.goodsType = "PORTFOLIO";
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams = {};
      this.handleQuery();
    },
    // 修改商品
    modifyPromotionCommodity (row) {
      this.$modal.confirm('确认修改商品吗？').then(function () {
        return updatePromotionGoods('PORTFOLIO', this.row.id, row.id,
          { price: row.price, orderNum: row.orderNum, limitMode: row.limitMode, limitNum: row.limitNum, unitage: row.unitage })
      }).then(() => {
        this.$modal.msgSuccess(text + "成功")
        this.goodsList()
      })
    },
    // 删除商品
    delSeckillCommodity(row) {
      var _this = this
      this.$modal.confirm("确认删除商品吗？")
        .then(function () {
          return delCombinationPackageGoods(row.portfolioSkuId, row.id).then(res=>{
            _this.goodsList()
          });
        });
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length != 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.updateTimeParagraphStatus = "新增";
      this.detailAppImageStatus = false;
      this.form = {};
      this.open1 = true;
    },
    submitForm() {
      this.form.productionDate = this.parseTime(this.form.productionDate, "{y}-{m}-{d} {h}{i}{s}");
      this.form.expirationDate = this.parseTime(this.form.expirationDate, "{y}-{m}-{d} {h}{i}{s}");

      let that = this;
      this.$modal
        .confirm("确认新增此组合套餐吗？")
        .then(function () {
          return newCombinationPackage(that.form);
        })
        .then(() => {
          this.$modal.msgSuccess("成功");
          this.open1 = false;
          this.getList();
        });
    },
    cancel() {
      this.detailAppImageStatus = false;
      this.form = {};
      this.open1 = false;
    },

    /** 修改按钮操作 */
    // handleUpdate (row) {
    //   this.updateTimeParagraphStatus = '修改'
    //   this.form = row
    //   this.form.detailAppImage = row.detailAppImage
    //   this.detailAppImageStatus = true
    //   this.open1 = true
    // },
    /** 导出按钮操作 */
    handleExport() {},
    // 上传图片
    requiredChange(e) {
      let formdata = new FormData();
      formdata.append("file", e.target.files[0]);
      uploadPicture(formdata).then((res) => {
        if (res.code === 200) {
          this.form.original = res.data.url;
          this.form.imageId = res.data.id;
          this.detailAppImageStatus = true;
        }
      });
    },
    handleRemove(file){},
    // 删除图片
    deletePicture() {
      if (this.updateTimeParagraphStatus === "新增") {
        document.getElementById("files").value = "";
      }
      this.form.original = "";
      this.detailAppImageStatus = false;
    },

    // 上架状态修改
    handleMarketEnableStatusChange(row) {
      let text = row.marketEnable === "UPPER" ? "上架" : "下架";
      this.$modal
        .confirm('确认"' + text + "  " + row.goodsName + '"组合套餐吗？')
        .then(function () {
          return changeGoodsSkuMarketEnable(
            row.goodsId,
            row.id,
            row.marketEnable
          );
        })
        .then(() => {
          this.$modal.msgSuccess(text + "成功");
        })
        .catch(function () {
          row.marketEnable = row.marketEnable === "UPPER" ? "DOWN" : "UPPER";
        });
    },
    // 更多操作触发
    handleCommand (command, row) {
      switch (command) {
        case "uploadproduct":
          this.Uploadproduct(row);
          break;
        case "openHandleSelectDate":
          this.openHandleSelectDate(row);
          break;
        case "openHandleSortOrder":
          this.openHandleSortOrder(row)
          break;
        case "handleChangeImage":
          this.handleChangeImage(row);
          break;
        default:
          break;
      }
    },
    openHandleSelectDate(row){
      this.form = {
        id: row.id,
        startTime: row.productionDate,
        endTime: row.expirationDate
      };

      this.title = "修改组合套餐生效时间";
      this.openUpdateTimeView = true;
    },
    submitFormToUpdateTime(){
      const _this = this;
      this.$modal.confirm("确认修改组合套餐的生效时间吗？")
      .then(function () {
        return handleTimeChange(_this.form.id, _this.form.startTime, _this.form.endTime).then(res=>{
          _this.$modal.msgSuccess("修改成功");
          _this.getList();
          _this.openUpdateTimeView = false;
        });
      }).catch(function(err) {
        _this.$modal.msgError("修改生效时间出错" + err.msg);
      });
    },
    openHandleSortOrder(row){
      this.form = {
        id: row.id,
        sortOrder: row.sortOrder
      };

      this.openUpdateSortOrderView = true
    },
    submitFormToUpdateSortOrder(){
      const _this = this;
      this.$modal.confirm("确认排序值吗？").then(function () {
        return changeGoodsSkuSortOrder(_this.form.id, _this.form.sortOrder).then(res=>{
          _this.$modal.msgSuccess("修改成功");
          _this.getList();
          _this.openUpdateSortOrderView = false;
        });
      }).catch(function(err) {
        _this.$modal.msgError("修改排序值出错" + err.msg);
      });
    },
    // 预览图片
    handlePictureCardPreview (file) {
      this.dialogImageUrl = file.raw.url;
      this.dialogVisible = true;
    },
    // 上传图片
    changeImg (file, fileList) {
      const ul = document.querySelector(".el-upload-list--picture-card");
      ul.nextSibling.style.display = "none";
      console.log(file, fileList);
      this.imageFileList = fileList;
    },
    handleChangeImage(row){
      this.imageFileList = [];
      this.form = {...row};

      this.openChangeImageView = true;
      this.title = "更换组合套餐图片";
    },
    changeImage(){
      if (!this.imageFileList) {
        this.$modal.msgError("请选择图片");
        return;
      }

      const _this = this;
      this.$modal.confirm("确认更换图片吗？").then(function () {
        const loading = _this.$loading({
          lock: true,
          text: "上传中...",
          spinner: "el-icon-loading",
          background: "rgba(0, 0, 0, 0.7)"
        });
        let formData = new FormData();
        formData.append("file", _this.imageFileList[0].raw);
        axios.post(`${process.env.VUE_APP_BASE_API}/oss/common/upload`, formData, {
          headers: _this.headers
        }).then(res => {
          if (res.status == 200) {
            let data = res.data;
            if (data.code == 200) {
              const changeImageData = {
                imageId: data.data.id,
                imageUrl: data.data.url
              }
              handleImageChange(_this.form.id, changeImageData).then(res=>{
                _this.$modal.msgSuccess("更换成功");
                _this.getList();
                _this.openChangeImageView = false;
              });
            } else {
              _this.$message.error("上传文件失败" + res.data.msg);
            }
          }
        }).finally(res => {
          loading.close();
        });
      }).catch(function(err) {
        console.log(err)
        _this.$modal.msgError("更换图片出错");
      });
    },
    /** 删除按钮操作 */
    handleDelete (row) {
      const ids = row.id || this.ids;
      this.$modal
        .confirm('确认删除组合套餐吗？')
        .then(function () {
          return deleteById(ids);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => { });
    },
  },
};
</script>

<style lang="scss" scoped>
.detailAppImage {
  width: 150px;
  height: 150px;
}
</style>
